#include "Sort.h"

void SortTest()
{
	int a[] = { 10,6,7,1,3,9,4,2 };
	int sz = sizeof(a) / sizeof(a[0]);


	for (int i = 0; i < sz; i++)
	{
		printf("%d ", a[i]);
	}
	printf("\n");
	MergeSortNonR(a, sz);
	for (int i = 0; i < sz; i++)
	{
		printf("%d ", a[i]);
	}
	printf("\n");
}

void SortTest1()
{
	int a[] = { 2,5,3,0,2,3,0,3 };
	int sz = sizeof(a) / sizeof(a[0]);

	for (int i = 0; i < sz; i++)
	{
		//a[i] = rand() % 100 + 1;
		printf("%d ", a[i]);
	}
	printf("\n");

	MergeSortNonR(a, sz);

	for (int i = 0; i < sz; i++)
	{
		printf("%d ", a[i]);
	}
	printf("\n");

}

void SortTest2()
{
	int a[10];
	int sz = sizeof(a) / sizeof(a[0]);

	for (int i = 0; i < sz; i++)
	{
		a[i] = rand() % 20 + 1;
		printf("%d ", a[i]);
	}
	printf("\n");

	CountSort(a, sz);

	for (int i = 0; i < sz; i++)
	{
		//a[i] = rand() % 20 + 1;
		printf("%d ", a[i]);
	}
	printf("\n");
}


int main()
{
	srand((unsigned)time(0));
	//SortTest1();
	SortTest2();

	return 0;
}